import service from "@/utils/request";
import type {
  skuType,
  skuListType,
  drawerType,
} from "@/api/product/model/skuType";
enum api {
  urlAddSku = "/admin/product/saveSkuInfo",
  urlSkuList = "/admin/product/list",
  urlSkutSaleCancle = "/admin/product/cancelSale",
  urlSkuSaleUp = "/admin/product/onSale",
  urlSkuDelete = "/admin/product/deleteSku",
  ulrSkuItem = "/admin/product/getSkuById",
}
export function reqAddSku(data: skuType) {
  return service.post(api.urlAddSku, data);
}
export function reqSkuList(page: number, limit: number) {
  return service.get<null, skuListType>(api.urlSkuList + `/${page}/${limit}`);
}
export function reqSkuSaleUp(id: number) {
  return service.get(api.urlSkuSaleUp + `/${id}`);
}
export function reqSkuSaleCancle(id: number) {
  return service.get(api.urlSkutSaleCancle + `/${id}`);
}
export function reqSkuDelete(id: number) {
  return service.delete(api.urlSkuDelete + `/${id}`);
}

export function reqSkuItem(id: number) {
  return service.get<null, drawerType>(api.ulrSkuItem + `/${id}`);
}
